//SPDX-FileCopyrightText: Copyright 2022-2024 深圳市同心圆网络有限公司
//SPDX-License-Identifier: GPL-3.0-only

package project_api_serv

import "atomgit.com/openlinksaas/proto-gen-go.git/project_api"

type ProjectList []*project_api.ProjectInfo

func (l ProjectList) Len() int {
	return len(l)
}

func (l ProjectList) Swap(i, j int) {
	l[i], l[j] = l[j], l[i]
}

func (l ProjectList) Less(i, j int) bool {
	if l[i].MyWeight == l[j].MyWeight {
		return l[i].UpdateTime < l[j].UpdateTime
	} else {
		return l[i].MyWeight < l[j].MyWeight
	}
}
